<template>
  <div class="container">
    <div class="descrips">
      <div class="score">
        {{i}}.<b>（单选题 {{detail.totalScore.toFixed(1)}}分）</b>
      </div>
      <template v-for="(item, index) in detail.descrips">
        <p v-if="item.type == 'fulltext'" :key="index" class="title">{{item.content}}</p>
      </template>
    </div>
    <div class="option">
      <div v-for="(item, index) in detail.options" class="option-item" :key="index">
        <p>{{item.code}}<b>.</b></p>
        <p>{{item.content}}</p>
      </div>
    </div>
    <div class="answer">
      <div class="answer-inline">
        <div class="student">学生答案：{{detail.studentAnswer.single}}</div>
        <div class="right">正确答案：{{detail.answer.single}}</div>
        <div class="correct">批改结果：<span>{{detail.isRight ? '正确' : '错误'}}</span></div>
        <div class="result">得分：{{detail.score.toFixed(1)}}分</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Basic",
  props: {
    i: {
      type: Number,
      default: 1
    }
  },
  data() {
    return {
      detail: {
        totalScore: 5.0,
        descrips: [{
          type: 'fulltext',
          content: '从以下选项中选择正确选项。'
        }],
        options: [{
          code: 'A',
          content: '这是选项A的内容'
        }, {
          code: 'B',
          content: '这是选项B的内容'
        }, {
          code: 'C',
          content: '这是选项C的内容'
        }],
        answer: { single: 'A' },
        studentAnswer: { single: 'A' },
        isRight: 1,
        score: 5.0,
      }
    }
  }
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
